package org.cskj.demo.demo.service.imp;

import org.cskj.demo.mapper.UserMapper;
import org.cskj.demo.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class UserService {
    @Autowired
    private UserMapper userMapper;
    public List<User> getall(int page,int pagesize){
        Map map=new HashMap();
        map.put("start",(page-1)*pagesize);
        map.put("end",pagesize);
        List<User> list = userMapper.selectLimit(map);
        return list;
    }
    public int count(){
        int i = userMapper.countByExample(null);
        return i;
    }
}
